package algorithms.roughgarden.part2.clustering;

public class Edge implements Comparable<Edge> {
	private Vertex v1;
	private Vertex v2;
	private int weight;
	
	public Edge(Vertex v1, Vertex v2, int weight){
		this.v1 = v1;
		this.v2 = v2;
		this.weight = weight;
	}
	

	public Vertex getVertex1() {
		return v1;
	}


	public Vertex getVertex2() {
		return v2;
	}


	public int getWeight() {
		return weight;
	}

	public int compareTo(Edge o) {
		return this.getWeight() - o.getWeight();
	}
	
	@Override
	public String toString() {
		return "("+v1+","+v2+","+weight+")";
	}

}
